/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Cristian
 */
@Entity
@Table(name = "pydgtbaresene")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Pydgtbaresene.findAll", query = "SELECT p FROM Pydgtbaresene p"),
    @NamedQuery(name = "Pydgtbaresene.findByPydgtbareseneid", query = "SELECT p FROM Pydgtbaresene p WHERE p.pydgtbareseneid = :pydgtbareseneid")})
public class Pydgtbaresene implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "pydgtbareseneid")
    private Integer pydgtbareseneid;
    @JoinColumn(name = "scaltbareainveid", referencedColumnName = "scaltbareainveid")
    @ManyToOne(optional = false)
    private Scaltbareainve scaltbareainveid;
    @JoinColumn(name = "pydgtbproyecid", referencedColumnName = "pydgtbproyecid")
    @ManyToOne(optional = false)
    private Pydgtbproyec pydgtbproyecid;

    public Pydgtbaresene() {
    }

    public Pydgtbaresene(Integer pydgtbareseneid) {
        this.pydgtbareseneid = pydgtbareseneid;
    }

    public Integer getPydgtbareseneid() {
        return pydgtbareseneid;
    }

    public void setPydgtbareseneid(Integer pydgtbareseneid) {
        this.pydgtbareseneid = pydgtbareseneid;
    }

    public Scaltbareainve getScaltbareainveid() {
        return scaltbareainveid;
    }

    public void setScaltbareainveid(Scaltbareainve scaltbareainveid) {
        this.scaltbareainveid = scaltbareainveid;
    }

    public Pydgtbproyec getPydgtbproyecid() {
        return pydgtbproyecid;
    }

    public void setPydgtbproyecid(Pydgtbproyec pydgtbproyecid) {
        this.pydgtbproyecid = pydgtbproyecid;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (pydgtbareseneid != null ? pydgtbareseneid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Pydgtbaresene)) {
            return false;
        }
        Pydgtbaresene other = (Pydgtbaresene) object;
        if ((this.pydgtbareseneid == null && other.pydgtbareseneid != null) || (this.pydgtbareseneid != null && !this.pydgtbareseneid.equals(other.pydgtbareseneid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entities.Pydgtbaresene[ pydgtbareseneid=" + pydgtbareseneid + " ]";
    }
    
}
